/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.core.repository;

import com.playground.core.entity.Room;
import com.playground.core.entity.RoomStatus;
import java.util.List;

/**
 *
 * @author Tiago Peres
 */
public interface RoomRepository {
    /**
     * Saves the specified room, if it doesn't exist creates it.
     * 
     * @param room the room to be saved
     * @return the recently saved room
     */
    Room save(Room room);
    
    /**
     * Retrieves the room with the given id.
     * @param id the id of the room to be retrieved
     * @return the room having its id equals to the specified id, or null if
     * there's no such room
     */
    Room findOne(long id);
    
    /**
     * Retrieves all rooms having theirs status equals to "status".
     * 
     * @param status the status of the rooms to be retrieved
     * @return the rooms having their status equals to the status passed as 
     * parameter
     */
    List<Room> findRoomByStatus(RoomStatus status);
    
    /**
     * Retrieves all the rooms in the system
     * @return all the rooms in the system
     */
    List<Room> findAll();
    
    /**
     * Removes all rooms
     */
    void deleteAll();
}
